package code.ui
{
	import code.utils.MaterialUtil;
	
	import com.darwin.darwinUI.controls.Label;
	import com.darwin.darwinUI.core.UIComponent;
	import com.darwin.darwinUI.general.TextFieldFactory;
	import com.darwin.darwinUI.manager.UIManager;
	import com.darwin.darwinUI.manager.base.IToolTip;
	import com.darwin.darwinUI.manager.base.ToolTipBase;
	
	import flash.display.Sprite;
	
	import module.main.view.ResourceConst;

	public class SimpleToolTips extends Sprite implements IToolTip
	{
		private var _showTxt:Label;
		private var _backGround:UIComponent;
		public function SimpleToolTips()
		{
			super();
			_backGround = new UIComponent;
			_backGround.backgroundSkin = ResourceConst.GENERAL_IMAGE_TIPS_BG;
//			_backGround = MaterialUtil.getPreloadMaterial("ToolTips","TOOL_TIPS_BG") as Sprite;
			addChild(_backGround);
			_backGround.alpha = 0.6;
			inView();
		}
		private function inView():void
		{
			mouseEnabled = false;
			mouseChildren = false;
			_showTxt = TextFieldFactory.getInstance().getLabel("simpleTooltip");
			_showTxt.x = 5;
			_showTxt.y = 5;
			addChild(_showTxt);
			/*this.graphics.beginFill(0x0099FF,0.9);
			this.graphics.drawRoundRect(0,0,100,100,10,10);
			this.graphics.endFill();*/
		}
//		private var height:uint;
		public function setData(data:Object, item:*):void
		{
			_showTxt.text = data.toString();
			_showTxt.htmlText = data.toString();
			_backGround.width = _showTxt.width+10;
			_backGround.height = _showTxt.height+5;
		}
	}
}